<?php
require_once( 'login.php' );
require_once( 'classes/mofachi.Article.php' );
//require_once( 'classes/mofachi.Baby.php' );

$recentArticles = Article::getRecent( 0, 10 );

require_once( 'classes/smarty_setup.php' );
$smarty = new Smarty_mofachi();
$smarty->assign( 'user', $_SESSION[ 'user' ] );
$smarty->assign( 'babies', $_SESSION[ 'babies' ] );
$smarty->assign( 'recentArticles', $recentArticles );
$smarty->display('smarty/templates/list.htm');

function getDays( $baby ) {
	$today = new DateTime(date('Y-m-d'));
	$birthday = new DateTime( $baby->birthday );		
	return date_diff($today,$birthday)->format("%a");
}
?>